package org.hy.framework.spring.hibernate3.entity;

import java.lang.reflect.Method;

import javax.persistence.ManyToOne;

import org.hy.commons.io.core.util.ReflectionUtil;
import org.hy.framework.hibernate3.example.entity.Student;

//import com.hy.commons.io.core.util.annotaion.MyAnnotation;

public class T {
	public static void main(String[] args) {
		Method[] methods = ReflectionUtil.getDeclaredAllMethod(Student.class);
		for (int i = 0; i < methods.length; i++) {
			Method method = methods[i];
			//判断该方法是否包含MyAnnotation注解
	        if(method.isAnnotationPresent(ManyToOne.class)){
	            //获取该方法的MyAnnotation注解实例
	        	ManyToOne myAnnotation = method.getAnnotation(ManyToOne.class);
	            //执行该方法
	            //method.invoke(annotationTest2, new Object[]{});
	            //获取myAnnotation
	            //String[] value1 = myAnnotation.
	            System.out.println(method);
	        }
	        //获取方法上的所有注解
	       // Annotation[] annotations = method.getAnnotations();
	       // for(Annotation annotation : annotations){
	        //    System.out.println(annotation);
	        //}
			
		}
	
	}

}
